package xcf.data.session;

import org.dom4j.DocumentException;
import xcf.data.config.XmlConfigBuilder;
import xcf.data.model.Configuration;
import xcf.data.session.defalut.DefaultSessionFactory;

import java.io.InputStream;
import java.sql.SQLException;

public class SessionFactoryBuilder {

    public ISessionFactory build(InputStream stream) throws DocumentException, SQLException {
        Configuration configuration = new XmlConfigBuilder().parse2Configuration(stream);
        return new DefaultSessionFactory(configuration);
    }
}
